import java.io.*;

/**
 * Test class ContactsList adds 6 new contact items to a list object and prints the list to
 * check if the contacts added correctly
 * 
 * @author Soyoung, JZ
 */
class TestContactsList {

	public static void main(String[] args) {

		ContactsList cList;
		cList = new ContactsList();
		
		Contact c1; 
		Contact c2; 
		Contact c3;
		Contact c4;
		Contact c5;
		Contact c6;
		String testLastName1;
		String testLastName2;
		String testLastName3;
		Name name1 = new Name("Jim", "Lehrer");
        StreetAddress s1 = new StreetAddress();
        s1.setHouse("12345 El Monte Road");
        s1.setCity("Los Altos Hills");
        s1.setState("CA");
        s1.setZip("94022");
        s1.setCountry("USA");
		Notes note1 = new Notes("The quick brown fox");
		EMail e1 = new EMail("jim.lehrer@thejimlehrershow.com");
		PhoneNum p1 = new PhoneNum("8881239876");
		
		Name name2 = new Name("Sonny", "Rollins");
		StreetAddress s2 = new StreetAddress();
        s2.setHouse("21250 Stevens Creek Blvd.");
        s2.setCity("Cupertino");
        s2.setState("CA");
        s2.setZip("95014");
        s2.setCountry("USA");
		Notes note2 = new Notes("Salt Peanuts");
		EMail e2 = new EMail("srollins@jazzlegends.com");
		PhoneNum p2 = new PhoneNum("7779097876");
		
		Name name3 = new Name("David", "Letterman");
		StreetAddress s3 = new StreetAddress();
        s3.setHouse("1 Rock Center");
        s3.setCity("New York City");
        s3.setState("NY");
        s3.setZip("04235");
        s3.setCountry("USA");
		Notes note3 = new Notes("The David Letterman Show");
		EMail e3 = new EMail("dave@worldwidepants.com");
		PhoneNum p3 = new PhoneNum("5548867373");
		
		Name name4 = new Name("Homestar", "Runner");
		StreetAddress s4 = new StreetAddress();
        s4.setHouse("88 Shady Lane");
        s4.setCity("Shady Acres");
        s4.setState("ME");
        s4.setZip("44569");
        s4.setCountry("USA");
		Notes note4 = new Notes("Games!");
		EMail e4 = new EMail("hrunner@sbemail.com");
		PhoneNum p4 = new PhoneNum("9944440001");
		
		Name name5 = new Name("Strong", "Bad");
		StreetAddress s5 = new StreetAddress();
        s5.setHouse("54 Shady Lane");
        s5.setCity("Shady Acres");
        s5.setState("ME");
        s5.setZip("44569");
        s5.setCountry("USA");
		Notes note5 = new Notes("SBEmail");
		EMail e5 = new EMail("strongbad@sebmail.com");
		PhoneNum p5 = new PhoneNum("9944450020");
		
		Name name6 = new Name("Sonny", "Rollins");
		StreetAddress s6 = new StreetAddress();
        s6.setHouse("21250 Stevens Creek Blvd.");
        s6.setCity("Cupertino");
        s6.setState("CA");
        s6.setZip("95014");
        s6.setCountry("USA");
		Notes note6 = new Notes("Salt Peanuts");
		EMail e6 = new EMail("srollins@jazzlegends.com");
		PhoneNum p6 = new PhoneNum("7779097876");
		
		c1 = new Contact(name1, note1, e1, p1, s1);
		c2 = new Contact(name2, note2, e2, p2, s2);
		c3 = new Contact(name3, note3, e3, p3, s3);
		c4 = new Contact(name4, note4, e4, p4, s4);
		c5 = new Contact(name5, note5, e5, p5, s5);
		c6 = new Contact(name6, note6, e6, p6, s6);
		
		cList.addContact(c1);
		System.out.println(" 1 Contact\n" + cList.toString());
		cList.addContact(c2);
		System.out.println(" 2 Contact\n" + cList.toString());
		cList.addContact(c3);
		System.out.println(" 3 Contact\n" + cList.toString());
		cList.addContact(c4);
		System.out.println(" 4 Contact\n" + cList.toString());
		cList.addContact(c5);
		System.out.println(" 5 Contact\n" + cList.toString());
		cList.addContact(c6);
		System.out.println(" 6 Contact\n" + cList.toString());
		testLastName1 = "Rollins";
		testLastName2 = "Kim";
		testLastName3 = "Bad";
		System.out.println("Contacts having same last Name with : " + testLastName1);
		System.out.println(cList.retrieveContact(testLastName1));
		if (cList.size() != 0) {
			System.out.println("Contacts having same last Name : " + testLastName2);
			System.out.println(cList.retrieveContact(testLastName2));
			}
		else System.out.println("No matching contacts having same last name : " + testLastName2);
		System.out.println("Contacts having same last Name : " + testLastName3);
		System.out.println(cList.retrieveContact(testLastName3));
	
	}
}
	
/* Sample Output
 1 Contact

Jim Lehrer
12345 El Monte Road
Los Altos Hills, CA 94022
USA
jim.lehrer@thejimlehrershow.com
888-123-9876
The quick brown fox

 2 Contact

Jim Lehrer
12345 El Monte Road
Los Altos Hills, CA 94022
USA
jim.lehrer@thejimlehrershow.com
888-123-9876
The quick brown fox

Sonny Rollins
21250 Stevens Creek Blvd.
Cupertino, CA 95014
USA
srollins@jazzlegends.com
777-909-7876
Salt Peanuts

 3 Contact

Jim Lehrer
12345 El Monte Road
Los Altos Hills, CA 94022
USA
jim.lehrer@thejimlehrershow.com
888-123-9876
The quick brown fox

David Letterman
1 Rock Center
New York City, NY 04235
USA
dave@worldwidepants.com
554-886-7373
The David Letterman Show

Sonny Rollins
21250 Stevens Creek Blvd.
Cupertino, CA 95014
USA
srollins@jazzlegends.com
777-909-7876
Salt Peanuts

 4 Contact

Jim Lehrer
12345 El Monte Road
Los Altos Hills, CA 94022
USA
jim.lehrer@thejimlehrershow.com
888-123-9876
The quick brown fox

David Letterman
1 Rock Center
New York City, NY 04235
USA
dave@worldwidepants.com
554-886-7373
The David Letterman Show

Sonny Rollins
21250 Stevens Creek Blvd.
Cupertino, CA 95014
USA
srollins@jazzlegends.com
777-909-7876
Salt Peanuts

Homestar Runner
88 Shady Lane
Shady Acres, ME 44569
USA
hrunner@sbemail.com
994-444-0001
Games!

 5 Contact

Strong Bad
54 Shady Lane
Shady Acres, ME 44569
USA
strongbad@sebmail.com
994-445-0020
SBEmail

Jim Lehrer
12345 El Monte Road
Los Altos Hills, CA 94022
USA
jim.lehrer@thejimlehrershow.com
888-123-9876
The quick brown fox

David Letterman
1 Rock Center
New York City, NY 04235
USA
dave@worldwidepants.com
554-886-7373
The David Letterman Show

Sonny Rollins
21250 Stevens Creek Blvd.
Cupertino, CA 95014
USA
srollins@jazzlegends.com
777-909-7876
Salt Peanuts

Homestar Runner
88 Shady Lane
Shady Acres, ME 44569
USA
hrunner@sbemail.com
994-444-0001
Games!

 6 Contact

Strong Bad
54 Shady Lane
Shady Acres, ME 44569
USA
strongbad@sebmail.com
994-445-0020
SBEmail

Jim Lehrer
12345 El Monte Road
Los Altos Hills, CA 94022
USA
jim.lehrer@thejimlehrershow.com
888-123-9876
The quick brown fox

David Letterman
1 Rock Center
New York City, NY 04235
USA
dave@worldwidepants.com
554-886-7373
The David Letterman Show

Sonny Rollins
21250 Stevens Creek Blvd.
Cupertino, CA 95014
USA
srollins@jazzlegends.com
777-909-7876
Salt Peanuts

Sonny Rollins
21250 Stevens Creek Blvd.
Cupertino, CA 95014
USA
srollins@jazzlegends.com
777-909-7876
Salt Peanuts

Homestar Runner
88 Shady Lane
Shady Acres, ME 44569
USA
hrunner@sbemail.com
994-444-0001
Games!

Contacts having same last Name with : Rollins

Sonny Rollins
21250 Stevens Creek Blvd.
Cupertino, CA 95014
USA
srollins@jazzlegends.com
777-909-7876
Salt Peanuts

Sonny Rollins
21250 Stevens Creek Blvd.
Cupertino, CA 95014
USA
srollins@jazzlegends.com
777-909-7876
Salt Peanuts

Contacts having same last Name : Kim

Contacts having same last Name : Bad

Strong Bad
54 Shady Lane
Shady Acres, ME 44569
USA
strongbad@sebmail.com
994-445-0020
SBEmail


*/ 	